#ifndef ARRAY_H_
#define ARRAY_H_

#include "../base/types.h"
#include "../base/Comparable.h"

template <class T>
class Array : public Comparable
{
	friend class ArrayTools;

private:
	T* value2;
	natural offset;
	natural count;
	int* counter;

	void unreference();
public:
	Array(natural arraySize);
	Array(const Array&);
	virtual ~Array();

	Array<T> operator=(const Array<T>& in);

	virtual bool equals(Comparable& in);

	natural length(){return count;}
	bool isEmpty(){return count == 0;}
	T& operator[](natural i);
};

#endif /* ARRAY_H_ */

#include "Array.hpp"
#include "ArrayTools.h"
